ia.Theme Class
Contains information about a ia.Theme.
Constructor
ia.Theme
-
geography
-
theme
-
data
Parameters:
-
geography
ia.GeographyThe geography the theme belongs to.
-
theme
ia.ThemeThe parent theme the theme belongs to or undefined if its a child of the geography.
-
data
JSONThe json data describing the object.
Item Index
Methods
- getChildren
- getComparisonData
- getComparisonDataForDate
- getData
- getDataForDate
- getDataTree
- getFeatureData
- getFirstIndicator
- getIndicator
- getIndicatorDates
- getIndicatorIds
- getIndicatorNames
- getIndicators
- getIndicators
- getNestedIndicator
- getParentThemes
- getProfileData
- getProperties
- getProperty
- getThemes
- loadData
- loadIndicator
- parseData
Methods
getChildren
()
Object
Returns an array of data objects that are children of this object.
Returns:
getComparisonData
-
indicatorId
Gets the themes indicator comparison data.
Parameters:
-
indicatorId
StringThe indicator id.
Returns:
getComparisonDataForDate
-
date
Gets the themes indicators with the given date.
Parameters:
-
date
StringThe date.
Returns:
getData
-
indicatorId
-
featureIds
Gets the themes indicator data.
Parameters:
-
indicatorId
StringAn optional indicator id.
-
featureIds
StringAn optional list of feature ids to get data for.
Returns:
getDataForDate
-
date
-
featureIds
Gets the themes indicator data with the given date.
Parameters:
-
date
StringThe date.
-
featureIds
StringAn optional list of feature ids to get data for.
Returns:
getDataTree
-
showDates
-
reverseDates
-
dataHash
-
parentId
Returns an associative array of the form:
["i1"]{id:"i1"; label:"Home"; type:"branch"; children:["i2"; "i3"; "i4"]}
["i2"]{id:"i2"; label:"ia.Indicator 1"; type:"branch"; parent:"i1"; children:["i5"; "i6"; "i7"]}
["i5"]{id:"i5~2004"; label:"2004"; type:"leaf"; parent:"i2"}
Used by data explorers. Dates are returned as part of the tree.
Parameters:
-
showDates
BooleanShould the dates be displayed.
-
reverseDates
BooleanShould the dates be reversed.
-
dataHash
Associative ArrayAn associative array as described.
-
parentId
StringThe parent id.
getFeatureData
-
feature
-
date
A hashtable of the indicators/associates for a feature - used by feature card.
Parameters:
-
feature
ObjectA feature object.
-
date
StringAn optional date.
Returns:
getFirstIndicator
-
reverseDates
Returns the first indicator - this can be within a nested ia.Theme. Where dates are used the first indicator is the one with the most recent date
Parameters:
-
reverseDates
BooleanShould the dates be reversed.
Returns:
getIndicator
-
id
-
date
-
reverseDates
Returns the indicator that corresponds to the id and date provided. Will include the latest date of an indicator if the specified date is unavailable.
Parameters:
-
id
StringThe indicator id.
-
date
StringAn optional date.
-
reverseDates
BooleanShould the dates be reversed.
Returns:
getIndicatorDates
-
indicatorId
Returns a list of dates for the indicator that matches the id provided.
Parameters:
-
indicatorId
StringThe indicator id.
Returns:
getIndicatorIds
()
String
Returns a list of indicator ids contained in the theme.
Returns:
getIndicatorNames
()
String
Returns a list of indicator names contained in the theme.
Returns:
getIndicators
-
date
Returns the indicators with the given date. Will include the latest date of an indicator if the specified date is unavailable.
Parameters:
-
date
StringThe date.
Returns:
getIndicators
-
indicatorId
Returns the indicators contained in the theme or with the given id if that is supplied.
Parameters:
-
indicatorId
StringAn optional indicator id.
Returns:
getNestedIndicator
-
id
-
date
-
reverseDates
Includes indicators in nested themes.
Parameters:
-
id
StringThe indicator id.
-
date
StringAn optional date.
-
reverseDates
BooleanShould the dates be reversed.
Returns:
getParentThemes
()
ia.Theme[]
Returns a list of the parent theme names including this one.
Returns:
getProfileData
-
featureIds
-
themeArray
-
date
-
useLatestDate
A hashtable of the indicators/associates for a feature - used for profiles.
The returned data has the following structure:
["t0"]{id:"t0", name:"theme0", type:"parent"}
["i0"]{id:"i0", name:"indicator0", value:2345, value_formatted:2345, associate1:25, associate1_formatted:25, type:"leaf"}
["i1"]{id:"i1", name:"indicator1", value:4347, value_formatted:4347, associate1:45, associate1_formatted:45, type:"leaf"}
["i2"]{id:"i2", name:"indicator1", value:2496, value_formatted:2496, associate1:25, associate1_formatted:25, type:"leaf"}
Parameters:
-
featureIds
StringA list of feature ids to get data for.
-
themeArray
ObjectThe array to add the theme objects to.
-
date
StringAn optional date.
-
useLatestDate
BooleanUse the latest date if the specified date is unavailable?
getProperties
()
Associative Array
Returns the custom properties. An associative array of the form: [propName] = propValue.
Returns:
getProperty
-
propName
Returns a value for a custom property.
Parameters:
-
propName
StringThe name of the property.
Returns:
getThemes
()
ia.Theme[]
Returns the themes contained in the ia.Theme.
Returns:
loadData
-
callbackFnc
Loads all data in the theme.
Parameters:
-
callbackFnc
FunctionThe callbackFnc gets called with the loaded object as the parameter.
loadIndicator
-
id
-
date
-
callbackFnc
Loads the indicator that corresponds to the id and date provided. The indicator can be in a nested ia.Theme. Returns the indicator via the supplied callback function.
Parameters:
-
id
StringThe indicator id.
-
date
StringAn optional date.
-
callbackFnc
FunctionThe callbackFnc gets called with the loaded object as the parameter.
parseData
-
data
Parses the JSON data.
Parameters:
-
data
JSONThe json data describing the object.
Properties
customColumns
Object} Array of columns.
The custom columns that can be used in the data table.
data
JSON
The raw json data describing the object.
fileName
String
The file name.
hasData
Boolean
Indicates if this object contains data.
Default: true
hasThemes
Boolean
Indicates if this theme contains nested themes.
Default: false
href
String
The href.
id
String
The id.
name
String
The name.
parent
Object
The parent object.
precision
Number
The precision. Inherited from parent if undefined.
type
Number
The data type. Inherited from parent if undefined.
Default: "categoric"